<template>
	<view :style="itemstyle">
		
		<block v-if="linkdata.link == '../customer/customer'">
			<block v-if="!customerService.is_open">
				<!-- #ifdef MP-WEIXIN -->
				<u-button :custom-style='customstyle' class="btns" open-type="contact"><slot></slot></u-button>
				<!-- #endif -->
				<!-- #ifndef MP-WEIXIN -->
				<view style="width: 100%;height: 100%;" @click="Jumpurl(link)"><slot></slot></view>
				<!-- #endif -->
			</block>
			<block v-else>
				<view style="width: 100%;height: 100%;" @click="Jumpurl(linkdata)"><slot></slot></view>
			</block>
		</block>

		<view style="width: 100%;height: 100%;" @click="Jumpurl(linkdata)" v-else><slot></slot></view>
	</view>
</template>

<script>
import {mapState, mapMutations} from 'vuex';
export default {
	name: 'customer',
	data() {
		return {
			customerService: '',
			link: {
				link: '../wxqcode/wxqcode',
				name: '客服二维码',
				id: 27,
				login_type: 1,
				type: 1
			},
			customstyle:{
				"height":'auto',
				"background-color": "transparent"
			}
		};
	},
	props: {
		linkdata: {
			type: Object,
			default: {}
		},
		itemstyle:{
			type: String,
			default: ''
		}
	},
	created() {	
		if (this.linkdata.link == '../customer/customer') {
			this.getjuris('customerService').then(a => {
				this.customerService = a;
			});
			// #ifdef MP-WEIXIN
				let plugins=getApp().globalData.plugins
				if(plugins&&plugins.indexOf('txyzf')==-1){
					this.customerService.is_open=0
				}
			// #endif
		}
	}
};
</script>

<style lang="scss">
.btns {
	height: auto;
	padding: 0;
	margin: 0;
	button {
		margin: 0;
		padding: 0!important;
		border: none;
		height: auto;
	}
}
.u-size-default{
height: auto;	
}
</style>
